package cn.cttic.base.api.domain.bo;

import cn.cttic.base.api.domain.BasePerson;
import cn.cttic.common.mybatis.core.domain.BaseEntity;
import cn.cttic.common.core.validate.AddGroup;
import cn.cttic.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;
import util.RegexpUtils;

import java.time.LocalDate;
import java.util.Date;

/**
 * 人员信息业务对象 base_person
 *
 * @author Times.Studio
 * @date 2024-09-17
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = BasePerson.class, reverseConvertGenerate = false)
public class BasePersonBo extends BaseEntity {

    /**
     *
     */
    @NotBlank(message = "不能为空", groups = { EditGroup.class })
    private String id;

    /**
     * 姓名
     */
    @NotBlank(message = "姓名不能为空", groups = { AddGroup.class, EditGroup.class })
    private String realName;

    /**
     * 身份证号码
     */
    @Pattern(regexp = "^(^[1-9]\\d{5}(18|19|([23]\\d))\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$)|(^[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{2}[0-9Xx]$)$", message = "请输入正确的身份证号", groups = { AddGroup.class, EditGroup.class })
    private String idCardNo;

    /**
     * 邮箱
     */
    @Pattern(regexp = RegexpUtils.EMAIL_REGEXP, message = "请输入正确的邮箱", groups = { AddGroup.class, EditGroup.class })
    private String email;

    /**
     * 头像
     */
    private String avatar;

    /**
     * 手机号
     */
    @NotBlank(message = "手机号不能为空", groups = { AddGroup.class, EditGroup.class })
    @Pattern(regexp = RegexpUtils.MOBILE_PHONE_REGEXP, message = "请输入正确的手机号", groups = { AddGroup.class, EditGroup.class })
    private String phone;

    /**
     * 身份证正面
     */
    private String front;

    /**
     * 身份证反面
     */
    private String back;

    /**
     * 所属企业
     */
    @NotBlank(message = "所属企业不能为空", groups = { AddGroup.class, EditGroup.class })
    private String companyId;

    /**
     * 性别
     */
    private Integer gender;

    /**
     * 生日
     */
    private LocalDate birthday;

    /**
     * 备注
     */
    private String remark;

    /**
     * 认证状态
     */
    private Integer status;


}
